package com.zhou.springcloud.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhouyongjun
 * @Description: ribbon 负载均衡 配置
 * @date 2021/3/24 19:28
 */
@Configuration
public class RibbonConfig {
    /**
        * @Description: 自定义 负载均衡规则
        * @author  zhouyongjun
    　　* @date 2021/3/24 19:30
    　　* @param []
    　　* @return com.netflix.loadbalancer.IRule
    　　* @throws
    */
    @Bean
    public IRule rule() {
        /*
        自定义规则
         */
        return new TestRule();
    }
}
